package com.sanbuTech.foundation.manager;

import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;

import com.sanbuTech.foundation.manager.base.BaseManager;
import com.sanbuTech.foundation.model.ExceptionRecord;

@Component("exceptionRecordManager")
public class ExceptionRecordManager extends BaseManager{

	private final String mapper = "com.threeStepServer.dao.ExceptionRecordMapperDao.";
	

	public int insertOne(ExceptionRecord exRecord){
		
		if(exRecord.getTrace().length() > 4096){
			exRecord.setTrace(exRecord.getTrace().substring(0, 4096));	//4096是根据数据库字段长度8192/2(utf-8字符集)算出来的
		}
		
		return dao.insertAndReturnAffectedCount(this.mapper+"insertOne", exRecord);
	}
	
	
}
